// Oren Talmor 021808274
  
package javaapplication1;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;



/**
 *
 * @author Oren Talmor 021808274
 */

public class Main {
    // readLine function
    // This function get user input (char by char) and returning String
    private static String readLine()
    {

        // the StringBuilder is used for getting the line from the user in a
        // dynamic fahsion (without creating a new object after every change)
        StringBuilder lineStream = new StringBuilder();
        // letter is used for getting each char from the user in System.in.read()
        // function
        char letter = 0;
        try {
           letter = (char) System.in.read();

           // while loop get char by char from the System.in.read()
           // function and stop when ENTER is resived
           while (letter != (char) 10 )
           {
               lineStream.append(letter);
               letter  =  (char) System.in.read();
               
           }
           
        }
        catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
         //converting the StringBuilder to String
         //(becuse of the function signiture)
         return   lineStream.toString();

}
}

    /**
     * @param args the command line arguments
     */
 /*   public static void main(String[] args) {
        // creating a temp string that represent each line of input
        String cmd = null;
        // create a simulation enverinment
        Simulation sim = new Simulation();
        // create a command protocol
        Commands com = new Commands(sim);
        Robot sr = new SmartRobot(new RV1());
        // This while repeats till user enters "exit"
        while (true)
        {
        cmd = readLine();
        com.runCommand(cmd);
        }

        
    }
}
*/